*************************************************************************************************
* Program to save data for regression-based significance tests to RATS database
*************************************************************************************************
* All data is read in as "___.rat" files.  However, code is included to also allow data to be read
* in as "___.db" (fame) and "___.xls" (excel) files (though this is commented out).  All data is
* written out as "___.rat", "___.db", and "___.xls" files.
*************************************************************************************************

calendar 1947 1 4
allocate 2020:04

*************************************************************************************************
* Reading the data in as "___.rat" files.
*************************************************************************************************

open data revgapsq_fnv_32yrs.rat
data(format=rats) / gb_revgapsq_f32

open data revgapvr_fnv_32yrs.rat
data(format=rats) / gb_revgapvr_f32

open data revgapsq_fnv_9yrs.rat
data(format=rats) / gb_revgapsq_f09

open data revgapvr_fnv_9yrs.rat
data(format=rats) / gb_revgapvr_f09

open data revgapsq_fnv_13yrs.rat
data(format=rats) / gb_revgapsq_f13

open data revgapvr_fnv_13yrs.rat
data(format=rats) / gb_revgapvr_f13

*************************************************************************************************
* For reference (but commented out), reading the data in as "___.db" or "___.xls" files.
*************************************************************************************************
/*
open data revgapsq_fnv_32yrs.db
data(format=fame) / gb_revgapsq_f32

open data revgapvr_fnv_32yrs.db
data(format=fame) / gb_revgapvr_f32

open data revgapsq_fnv_9yrs.db
data(format=fame) / gb_revgapsq_f09

open data revgapvr_fnv_9yrs.db
data(format=fame) / gb_revgapvr_f09

open data revgapsq_fnv_13yrs.db
data(format=fame) / gb_revgapsq_f13

open data revgapvr_fnv_13yrs.db
data(format=fame) / gb_revgapvr_f13


open data revgapsq_fnv_32yrs.xls
data(format=xls,org=obs) / gb_revgapsq_f32

open data revgapvr_fnv_32yrs.xls
data(format=xls,org=obs) / gb_revgapvr_f32

open data revgapsq_fnv_9yrs.xls
data(format=xls,org=obs) / gb_revgapsq_f09

open data revgapvr_fnv_9yrs.xls
data(format=xls,org=obs) / gb_revgapvr_f09

open data revgapsq_fnv_13yrs.xls
data(format=xls,org=obs) / gb_revgapsq_f13

open data revgapvr_fnv_13yrs.xls
data(format=xls,org=obs) / gb_revgapvr_f13
*/

*************************************************************************************************
* Writing all the gap estimates to files.
*************************************************************************************************

open copy table1_reg_test_data.rat
copy(format=rats) / gb_revgapsq_f32 gb_revgapvr_f32 gb_revgapsq_f09 gb_revgapvr_f09 gb_revgapsq_f13 gb_revgapvr_f13

open copy table1_reg_test_data.db
copy(format=fame) / gb_revgapsq_f32 gb_revgapvr_f32 gb_revgapsq_f09 gb_revgapvr_f09 gb_revgapsq_f13 gb_revgapvr_f13

open copy table1_reg_test_data.xls
copy(format=xls,org=obs,dates) / gb_revgapsq_f32 gb_revgapvr_f32 gb_revgapsq_f09 gb_revgapvr_f09 gb_revgapsq_f13 gb_revgapvr_f13

* halt
